package com.jrx.anytxn.transaction.dto.payment;

import com.jrx.anytxn.transaction.dto.common.CommonReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.*;
import java.math.BigDecimal;

/**
 *  提前还款请求实体
 * @author  jing.xy
 * date  2019/10/23
 **/
@ApiModel(value = "提前还款请求实体", description = "提前还款请求实体")
public class PrePayReq extends CommonReq {
    /**
     * 外部合同号
     */
    @ApiModelProperty(value = "外部合同号")
    @Size(max=60, message = "外部合同号不能超过60位")
    private String contractNumber;
    /**
     * 订单（贷款）ID
     */
    @ApiModelProperty(value = "订单（贷款）ID")
    @Size(max=32, message = "订单号不能超过32位")
    private String loanId;

    /**
     * 还款类型
     */
    @ApiModelProperty(value = "还款类型 0：代扣 从客户卡上扣款;1：代还 从平台账户扣款",required = true)
    @NotBlank(message="还款类型不可空")
    @Pattern(regexp = "^0|1$" ,message = "还款类型 只能是0或1")
    private String paymentType;
    /**
     * 卡号
     */
    @ApiModelProperty(value = "卡号")
    @Size(max=32, message = "卡号不能超过32位")
    private String cardNumber;

    /**
     * 还款本金
     */
    @ApiModelProperty(value = "还款本金")
    @DecimalMin(value="0",message = "还款本金必需大于0")
    private BigDecimal principalAmount;

    @ApiModelProperty(value = "还款总金额")
    @DecimalMin(value="0",message = "还款本金必需大于0")
    private BigDecimal paymentAmount;

    public BigDecimal getPrincipalAmount() {
        return principalAmount;
    }

    public void setPrincipalAmount(BigDecimal principalAmount) {
        this.principalAmount = principalAmount;
    }

    public String getContractNumber() {
        return contractNumber;
    }

    public void setContractNumber(String contractNumber) {
        this.contractNumber = contractNumber;
    }

    public String getLoanId() {
        return loanId;
    }

    public void setLoanId(String loanId) {
        this.loanId = loanId;
    }

    public String getPaymentType() {
        return paymentType;
    }

    public void setPaymentType(String paymentType) {
        this.paymentType = paymentType;
    }

    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    public BigDecimal getPaymentAmount() {
        return paymentAmount;
    }

    public void setPaymentAmount(BigDecimal paymentAmount) {
        this.paymentAmount = paymentAmount;
    }
}
